package com.itheima.localdatetime;

import java.time.LocalDate;
import java.time.Period;

public class Demo06 {

    public static void main(String[] args) {
        LocalDate now = LocalDate.of(2021, 10, 13);
        LocalDate dangBirthday = LocalDate.of(1921, 7, 1);

        Period between = Period.between(dangBirthday,now);
        System.out.println(between);
        //get
        System.out.println(between.getYears());
        System.out.println(between.getMonths());
        System.out.println(between.getDays());

        //to
        System.out.println(between.toTotalMonths());
        System.out.println(1/0);
    }
}
